import wtforms
from wtforms.validators import length, number_range
from models import Users


class LoginForm(wtforms.Form):
    username = wtforms.StringField(validators=[length(4, 12)])
    password = wtforms.StringField(validators=[length(4, 12)])


class PatientForm(wtforms.Form):
    name = wtforms.StringField(validators=[length(-1, 30)])
    disease = wtforms.StringField(validators=[length(-1, 50)])
    address = wtforms.StringField(validators=[length(-1, 100)])
    age = wtforms.IntegerField(validators=[number_range(-1, 200)])
    sex = wtforms.IntegerField(validators=[number_range(1, 2)])


class IdForm(wtforms.Form):
    id = wtforms.IntegerField()


class TableForm(wtforms.Form):
    page = wtforms.IntegerField()
    limit = wtforms.IntegerField()

class ImageForm(wtforms.Form):
    patient_id = wtforms.IntegerField()
    model_kind = wtforms.IntegerField()